<!--
 * @Author: 卡卡 1071780426@qq.com
 * @Date: 2022-11-05 09:34:27
 * @LastEditors: 卡卡 1071780426@qq.com
 * @LastEditTime: 2023-11-22 15:25:17
 * @FilePath: \mould\src\components\public\el-tree.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->


<template>
    <!-- materialList -->
    <!-- current-node-key -->
    <!-- ['0fea35c0-6fd2-4825-936d-cff9c00aab38', 'ae54000f-d1b5-4e30-affc-d7533490ba71', 'a3f676d3-d557-4864-9aa2-d452a2dbc85a'] -->
    <el-tree
      :data="treeData"
      :props="defaultProps"
      :highlight-current="highlightBd"
      @node-click="handleNodeClick"
      node-key="fId"
      :accordion="true"
      :expand-on-click-node="false"
      :default-checked-keys="checkData"
      :default-expanded-keys="checkData"
      :current-node-key="checkData[0]"
    ></el-tree>
  </template>
  <script>
  export default {
    props: {
      treeData: {
        type: Array,
        default: () => [],
      },
      checkData: {
        type: Array,
        default: () => [],
      },
      defaultProps: {
        type: Object,
        default: () => {},
      },
      nodeKey: {
        type: String,
        default: "fCompanyid",
      },
  
      // dataList: {
      //     type: Array,
      //     default: () => {
      //         return []
      //     }
      // },
      // loading: {
      //     type: Boolean,
      //     default: false
      // }
    },
    data() {
      return {
        // treeData: [],
        // 左侧机构树
        // defaultProps: {
        //     children: "children",
        //     label: "fShortname",
        // },
        highlightBd: true, //左侧机构树停留背景色
      };
    },
    watch: {
      fileDetail: {
        handler(newVal) {
          if (newVal) {
            this.pdfUrl = newVal.url;
            this.fFileName = newVal.fFileName;
          }
        },
        immediate: true,
      },
    },
    mounted() {},
    methods: {
      handleNodeClick(data) {
      
        this.$emit("getTreeInfo", data);
        
      },
    },
  };
  </script>
  <style scoped>
  .tree {
    height: 100%;
  }
  </style>
  